package com.test.nnooolwdeaer.util_wooden.analytics_wooden.bean_wooden

import android.content.pm.PackageManager
import android.os.Build
import com.test.nnooolwdeaer.activity_fragment_wooden.base_wooden.BaseApplication_wooden
import com.test.nnooolwdeaer.constant_wooden.Constant_wooden
import com.test.nnooolwdeaer.util_wooden.analytics_wooden.util_wooden.AnalyticsUtil_wooden
import com.test.nnooolwdeaer.util_wooden.analytics_wooden.util_wooden.FirebaseUtil_wooden
import java.util.*

class ParamFirebaseS2S_wooden(
    /** 产品名 */
    var name: String = BaseApplication_wooden.getApplication().getPackageName(),
    /** 版本号 */
    var OSAndVersion: String = "Android ${Build.VERSION.RELEASE}",
    /** 语言 */
    var locale: String = Locale.getDefault().toString(),
    /** 设备 */
    var device: String = Build.MODEL,
    /** app版本号 */
    var appVersion: String = BaseApplication_wooden.getApplication().versionCodeStr(),
    /** sdk版本号 */
    var sdkVersion: String = BaseApplication_wooden.getApplication().versionCodeStr(),
    /** build */
    var build: String = "Build/${Build.ID}",
    /** 广告是否限制跟踪 */
    var lat: String = AnalyticsUtil_wooden.getAdEnabled().toString(),
    /** firebasse id */
    var firebaseAppId: String = FirebaseUtil_wooden.getFirebaseAppId(),
    /** ga4 id */
    var ga4AppInstanceId: String = FirebaseUtil_wooden.getGa4InstanceId()
) : ParamBase_wooden() {
    init {
        //组装版本号
        val vVersion =
            BaseApplication_wooden.getApplication().packageManager.getPackageInfo(
                BaseApplication_wooden.getApplication().packageName,
                PackageManager.GET_META_DATA
            ).versionName
        this.appVersion = vVersion ?: ""
        this.sdkVersion = vVersion ?: ""
    }
}


